/**
 * 
 */
package jpa_objects;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;

/**
 * @author Alejandro Casas
 * @author Rodrigo Cifuentes
 */
@Entity
public class Sport_calification {

	private long id;
	private Sport sport;
	private int number_of_califications;
	private double average_calification;
	
	/**
	 * @return the number_of_califications
	 */
	public int getNumber_of_califications() {
		return number_of_califications;
	}
	/**
	 * @param number_of_califications the number_of_califications to set
	 */
	public void setNumber_of_califications(int number_of_califications) {
		this.number_of_califications = number_of_califications;
	}
	/**
	 * @return the id
	 */
	@Id
	@GeneratedValue
	public long getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(long id) {
		this.id = id;
	}
	/**
	 * @return the sport
	 */
	@OneToOne(targetEntity=Sport.class,cascade=CascadeType.ALL)
	public Sport getSport() {
		return sport;
	}
	/**
	 * @param sport the sport to set
	 */
	public void setSport(Sport sport) {
		this.sport = sport;
	}
	
	/**
	 * @return the average_calification
	 */
	public double getAverage_calification() {
		return average_calification;
	}
	/**
	 * @param average_calification the average_calification to set
	 */
	public void setAverage_calification(double average_calification) {
		this.average_calification = average_calification;
	}
	/**
	 * 
	 */
	public Sport_calification() {
		super();
		
	}
	/**
	 * @param sport
	 * @param calification
	 * @param average_calification
	 */
	public Sport_calification(Sport sport, int number_of_califications,
			double average_calification) {
		this.sport = sport;
		this.number_of_califications = number_of_califications;
		this.average_calification = average_calification;
	}
	
	
}
